package com.example.pc.system_broadcastreceiver.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class ScreenActionBroadcastReceiver extends BroadcastReceiver {

    private static final String TAG = ScreenActionBroadcastReceiver.class.getSimpleName();

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action != null) {
            if (action.equals(Intent.ACTION_SCREEN_ON)) {
                Log.d(TAG, "onReceive()---> " + "屏幕解锁！");
            } else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
                Log.d(TAG, "onReceive()---> " + "屏幕锁定！");
            }
        }
    }

}
